home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qwellarray.h.z / qwellarray.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.0 KB  |  77 lines

  1. /**********************************************************************
  2. ** $Id: qwellarray.h,v 1.6 1998/07/03 00:09:54 hanord Exp $
  3. **
  4. ** Definition of QWellArray widget class
  5. **
  6. ** Created : 980114
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QWELLARRAY_H
  25. #define QWELLARRAY_H
  26.  
  27. #ifndef QT_H
  28. #include "qtableview.h"
  29. #endif // QT_H
  30.  
  31. struct QWellArrayData;
  32.  
  33. class QWellArray : public QTableView
  34. {
  35.     Q_OBJECT
  36. public:
  37.     QWellArray( QWidget *parent=0, const char *name=0, bool popup = FALSE );
  38.  
  39.     ~QWellArray() {}
  40.     const char* cellContent( int row, int col ) const;
  41.     void setCellContent( int row, int col, const char* );
  42.  
  43.     int numCols() { return nCols; }
  44.     int numRows() { return nRows; }
  45.  
  46.     QSize sizeHint() const;
  47.  
  48.     virtual void setDimension( int rows, int cols );
  49.     void setCellBrush( int row, int col, const QBrush & );
  50.  
  51. protected:
  52.     void setSelected( int row, int col );
  53.     void setCurrent( int row, int col );
  54.  
  55.     void drawContents( QPainter *, int row, int col, const QRect& );
  56.     void drawContents( QPainter * );
  57.  
  58.     void paintCell( QPainter*, int row, int col );
  59.     void mousePressEvent( QMouseEvent* );
  60.     void mouseMoveEvent( QMouseEvent* );
  61.     void keyPressEvent( QKeyEvent* );
  62.     void focusInEvent( QFocusEvent* );
  63.     void focusOutEvent( QFocusEvent* );
  64.  
  65. private:
  66.     int curRow;
  67.     int curCol;
  68.     int selRow;
  69.     int selCol;
  70.     int nCols;
  71.     int nRows;
  72.     bool smallStyle;
  73.     QWellArrayData *d;
  74. };
  75.  
  76. #endif
  77.